import os

class ReadFileUtil:
    def read_file_name(self, dir): #递归读文件路径
        self.results = []
        base_file_name = os.listdir(dir)
        for item in base_file_name:
            full_path = os.path.join(dir, item)  # 拼接完整路径
            if os.path.isdir(full_path):
                self.results += self.read_file_name(full_path)
            else:
                self.results.append(full_path)
        return self.results

    def get_file_compare(self,base_list ,db_list): #对比数据库文件，返回未处理文件
        result = []
        for i in base_list:
            if i  not in db_list:
                result.append(i)
        return result
        #return list(set(base_list)-set(db_list)) 另一写法